/**
 * LawDataTagServiceImpl.java
 * @author
 * 作者 屈甲康 
 */
package org.jackysoft.service.impl;

import java.util.Collection;

import javax.annotation.Resource;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jackysoft.data.AbstractDataProvider;
import org.jackysoft.entity.OfficeDataValue;
import org.jackysoft.mapper.OfficeDataValueMapper;
import org.jackysoft.service.OfficeDataRegionService;
import org.springframework.dao.DataAccessException;
import org.springframework.stereotype.Service;

@Service
public class OfficeDataRegionServiceImpl extends
		AbstractDataProvider<OfficeDataValue> implements
		OfficeDataRegionService {
	final static Log logger = LogFactory
			.getLog(OfficeDataRegionServiceImpl.class);

	
	@Resource
	OfficeDataValueMapper mapper;
	
	public OfficeDataRegionServiceImpl() {
		super();
	}

	@Override
	public Collection<OfficeDataValue> findAllByRefid(long refid)
			throws DataAccessException {
		Collection<OfficeDataValue> list = mapper.findByRefid(refid);
				
		return list;
	}

	@Override
	public Collection<OfficeDataValue> findAllByRefname(String pname)
			throws DataAccessException {
		Collection<OfficeDataValue> list = mapper.findByRefname(pname);
		return list;
	}

	@Override
	public void removeByRefid(long refid)
			throws DataAccessException {
		mapper.removeByRefid(refid);

	}

	@Override
	public void removeByRefname(String refname)
			throws DataAccessException {
		mapper.removeByRefname(refname);

	}

	@Override
	public String getValue(long refid, String name)
			throws DataAccessException {
		String val = mapper.findValue(refid, name);
		return val;
	}

	@Override
	public void removeByName(long refid,String name) throws DataAccessException {
		mapper.removeByName(refid,name);
		
	}

}